﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.WindowsAzure.StorageClient;

namespace Thor.Repository.Azure.Table
{
    /// <summary>
    /// Representa a row in the Calendar table.
    /// </summary>
    internal class CalendarRow : TableServiceEntity
    {
        #region Constructors

        public CalendarRow() : base() { }

        public CalendarRow(string applicationName, string calendarEmail)
            : base(applicationName, calendarEmail)
        {
            ApplicationName = applicationName;
            CalendarEmail = calendarEmail;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Name of the application accessing the table.
        /// </summary>
        public string ApplicationName { get; set; }

        /// <summary>
        /// The email address of the calendar.
        /// </summary>
        public string CalendarEmail { get; set; }

        /// <summary>
        /// The calendar's alias (i.e. friendly name).
        /// </summary>
        public string Alias { get; set; }

        /// <summary>
        /// Unique id of the calendar.
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// Time zone of the calendar.
        /// </summary>
        public string TimeZone { get; set; }

        /// <summary>
        /// Whether or not the calendar uses a booking agent.
        /// </summary>
        public bool UseBookingAgent { get; set; }

        /// <summary>
        /// Whether or not the subject of the calendar's
        /// appointments are displayed.
        /// </summary>
        public bool DisplaySubject { get; set; }

        /// <summary>
        /// Whether or not unauthenticated users can view
        /// appointments on the calendars.
        /// </summary>
        public bool PublicCanView { get; set; }

        /// <summary>
        /// Whether or not unauthenticated users can book
        /// appointments on the calendar.
        /// </summary>
        public bool PublicCanBook { get; set; }

        /// <summary>
        /// Whether or not to use a timeframe when displaying
        /// appointments.
        /// </summary>
        public bool UseTimeframe { get; set; }

        /// <summary>
        /// Start time of the timeframe.
        /// </summary>
        public int? StartTime { get; set; }

        /// <summary>
        /// End time of the timeframe.
        /// </summary>
        public int? EndTime { get; set; }

        #endregion
    }
}
